package com.example.base;

import android.app.Application;
import android.util.Log;

import com.example.dellpc.myapplication.R;

import java.util.HashSet;
import java.util.Set;

import cn.jpush.android.api.CustomPushNotificationBuilder;
import cn.jpush.android.api.JPushInterface;
import cn.jpush.android.api.TagAliasCallback;

/**
 * Created by 刘智强 on 2016/9/20.
 */
public class MyApplication extends Application {
    //唯一baseapp的引用
    private static MyApplication baseApp;

    public static MyApplication getInstance() {
        if (baseApp == null) {
            throw new NullPointerException("baseapp 为空");
        }
        return baseApp;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        //初始化极光推送SDK
        JPushInterface.setDebugMode(true);// 开启调试模式，发版的时候关闭
        JPushInterface.init(this);

        //建议添加tag标签，发送消息的之后就可以指定tag标签来发送了
//        Set<String> set = new HashSet<>();
//        set.add("testJPush");//名字任意，可多添加几个
//        JPushInterface.setTags(this, set, null);//设置标签
    }


}
